package com.dbz.service.Impl;

import com.dbz.dao.RolesModulesDao;
import com.dbz.entity.RolesMopdule;
import com.dbz.service.RolesModulesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RolesModulesServiceImpl implements RolesModulesService {
    @Resource
    private RolesModulesDao rolesModulesDao;

    /**
     * 添加
     * @param rid
     * @param mids
     * @return
     */
    @Override
    public int insertRoleAndModule(String rid, String mids) {
        return rolesModulesDao.insertRoleAndModule(rid, mids);
    }

    /**
     * 删除模块信息
     * @param rid mids
     * @param mids
     * @return
     */
    @Override
    public int deleteRoleAndModules(String rid, String mids) {
        return rolesModulesDao.deleteRoleAndModules(rid,mids);
    }

    /**
     * 查询角色是否拥有模块
     * @param rid
     * @return
     */
    @Override
    public List<RolesMopdule> selectRoMoByRid(String rid) {
        return rolesModulesDao.selectRoMoByRid(rid);
    }
}
